export const filterLabel = (params: any) => {
    if (!params.data || params.data.name === '' || params.data.itemStyle?.opacity === 0) {
        return ''; // 不显示空白段
    }
    return `{name|${params.data.name}}`;
};

export const filterEmphasis = (params: any) => {
    if (!params.data || params.data.name === '' || params.data.itemStyle?.opacity === 0) {
        return '';
    }
    return `{name|${params.data.name}}\n{range|${params.data.start}-${params.data.end}}`;
};

export const colorList = [
    '#5470C6',
    '#91CC75',
    '#FAC858',
    '#EE6666',
    '#73C0DE',
    '#3BA272',
    '#FC8452',
    '#9A60B4',
    '#EA7CCC',
    '#26C0C0',
    // — 以下为 Sasha Trubetskoy 的配色共 20 色 —
    '#e6194b',
    '#3cb44b',
    '#ffe119',
    '#4363d8',
    '#f58231',
    '#911eb4',
    '#46f0f0',
    '#f032e6',
    '#bcf60c',
    '#fabebe'
];

export const groupDict: any = {
    cellline: 'Cellline',
    sample_type: 'SampleType',
    lineage: 'OncotreeLineage',
    gene: 'Gene'
};

export const cancerDict: any = {
    LAML: 'Acute Myeloid Leukemia',
    ACC: 'Adrenocortical carcinoma',
    BLCA: 'Bladder Urothelial Carcinoma',
    LGG: 'Brain Lower Grade Glioma',
    BRCA: 'Breast invasive carcinoma',
    CESC: 'Cervical squamous cell carcinoma and endocervical adenocarcinoma',
    CHOL: 'Cholangiocarcinoma',
    LCML: 'Chronic Myelogenous Leukemia',
    COAD: 'Colon adenocarcinoma',
    CNTL: 'Controls',
    ESCA: 'Esophageal carcinoma',
    FPPP: 'FFPE Pilot Phase II',
    GBM: 'Glioblastoma multiforme',
    HNSC: 'Head and Neck squamous cell carcinoma',
    KICH: 'Kidney Chromophobe',
    KIRC: 'Kidney renal clear cell carcinoma',
    KIRP: 'Kidney renal papillary cell carcinoma',
    LIHC: 'Liver hepatocellular carcinoma',
    LUAD: 'Lung adenocarcinoma',
    LUSC: 'Lung squamous cell carcinoma',
    DLBC: 'Lymphoid Neoplasm Diffuse Large B-cell Lymphoma',
    MESO: 'Mesothelioma',
    MISC: 'Miscellaneous',
    OV: 'Ovarian serous cystadenocarcinoma',
    PAAD: 'Pancreatic adenocarcinoma',
    PCPG: 'Pheochromocytoma and Paraganglioma',
    PRAD: 'Prostate adenocarcinoma',
    READ: 'Rectum adenocarcinoma',
    SARC: 'Sarcoma',
    SKCM: 'Skin Cutaneous Melanoma',
    STAD: 'Stomach adenocarcinoma',
    TGCT: 'Testicular Germ Cell Tumors',
    THYM: 'Thymoma',
    THCA: 'Thyroid carcinoma',
    UCS: 'Uterine Carcinosarcoma',
    UCEC: 'Uterine Corpus Endometrial Carcinoma',
    UVM: 'Uveal Melanoma'
};
